package com.siloam.vo;

import java.text.SimpleDateFormat;

import com.siloam.module.Article;
import com.siloam.module.ArticleCategory;
import com.siloam.module.User;

public class ArticleVO {
	private int id;
	private String title;
	private String content;
	private String date;
	private String articleType;
	private ArticleCategory articleCategory;
	private User author;
	
	public ArticleVO(Article article){
		setId(article.getId());
		setTitle(article.getTitle());
		setContent(article.getContent());
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
		setDate(article.getDateText(sdf));
		setAuthor(article.getAuthor());
		setArticleCategory(article.getArticleCategory());
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getDate() {
		return date;
	}
	public void setDate(String date) {
		this.date = date;
	}
	public String getArticleType() {
		return articleType;
	}
	public void setArticleType(String articleType) {
		this.articleType = articleType;
	}
	public ArticleCategory getArticleCategory() {
		return articleCategory;
	}
	public void setArticleCategory(ArticleCategory articleCategory) {
		this.articleCategory = articleCategory;
	}
	public User getAuthor() {
		return author;
	}
	public void setAuthor(User author) {
		this.author = author;
	}
	
}
